//
//  AContrller.m
//  TestNav3
//
//  Created by pier on 12-5-28.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "AContrller.h"

@implementation AContrller

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}



- (IBAction)hideBar:(id)sender {
    if([self.navigationController.navigationBar isHidden] == YES){
        [self.navigationController.navigationBar setHidden:NO];
    }
    else{
        [self.navigationController.navigationBar setHidden:YES];
        //        [self.navigationController setNavigationBarHidden:YES];
        //        self.navigationController.navigationBar.hidden = YES;
    }
}

- (IBAction)customBgImg:(id)sender {
}

- (IBAction)addLeftBtn:(id)sender {
    UIBarButtonItem *left = [[UIBarButtonItem alloc] 
                             initWithTitle:@"leftBtn" 
                             style:UIBarButtonItemStyleBordered 
                             target:self 
                             action:@selector(leftBtnPressed)];

    self.navigationItem.leftBarButtonItem = left;
    [left release]; 
}

- (IBAction)changeTitle:(id)sender {
    self.navigationController.title = @"hello world!";
}
- (IBAction)changeTitleView:(id)sender {
}

- (IBAction)addRightBtn:(id)sender {
    UIBarButtonItem *right = [[UIBarButtonItem alloc] 
                            initWithImage:[UIImage imageNamed:@"return.png"] 
                            style:UIBarButtonItemStylePlain 
                            target:self 
                            action:@selector(rightBtnPressed)];
    self.navigationItem.rightBarButtonItem = right;
    [right release];
    
}

- (IBAction)changeBackBtn:(id)sender {
}

- (IBAction)pushBController:(id)sender {
}





- (IBAction)removeSlefView:(id)sender {
    [self.view removeFromSuperview];
}

- (IBAction)changeSubView:(id)sender {
    
}

- (IBAction)dismissModalView:(id)sender {
    [self dismissModalViewControllerAnimated:YES];
}
@end
